บันทึกของบี

บันทึกการเดินทาง บนเส้นทางเดินแห่งชีวิต ของคนธรรมดาคนหนึ่ง

Ch3 Common programming concepts **

2026-01-30 ใน The rust programming language 3rd edition(online document)

3.1 Variable and Mutability

How to apply this

  • mut can't change type, but the value bound to variable, and will retain the value from sub {scope} to the higher {scope}
  • shadowing can change the type of the varible, and the new value will retain only within the sub {scope}
  • though the variable is const you can define as mathematical calculation, it will be calculated first and changed to constant expression.

3.2 Data Types

3.3 function